<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>二级下拉菜单</title>
    <style>
        ul,li {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .parent {
            width: 1090px;
            margin: auto;
        }
        .parent > div{
            float: left;
            line-height: 2em;
            width: 100px;
            background-color: burlywood;
            margin-right: 10px;
            text-align: center;
        }
        ul li {
            background-color: #fff;
            border-bottom: 1px solid #555;
        }
        ul {
            display: none;
        }
        /* ul:hover当光标悬浮到ul上时，ul不会消失 */
        /* ul:hover {
            display: block;
        }
        .one:hover + ul {
            display: block;
        } */
        .child:hover ul {
            display: block;
        }
        
        /* 定宽的二级菜单 */
        .parent {
            position: relative;
        }
        .two li {
            position: absolute;
            width: 100%;
            background-color: brown;
            left: 0;
        }
    </style>
</head>
<body>
    <div class="parent">
        <div class="child">
            <div class="one">one</div>
            <ul class="two">
                <li>
                    <div>1</div>
                    <div>2</div>
                    <div>3</div>
                </li>
            </ul>
        </div>
        <div class="child">
            <div class="one">one</div>
            <ul class="two">
                <li>2</li>
            </ul>
        </div>
        <div>three</div>
    </div>
</body>
</html>